﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site1.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<LibraryMusicStore.Album>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Index of storemanager</h2>
    
    <p>
        <%= Html.ActionLink("Create New", "Create") %>
    </p>
    
    <table>
        <tr>
            <th>
                Genre
            </th>
            <th>
                Artist
            </th>
            <th>
                Title
            </th>
            <th>
                Price
            </th>
            
            <th></th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.Encode(item.Genre.Name) %>
            </td>
            <td>
                <%= Html.Encode(HtmlHelpers.Truncate(item.Artist.Name, 20)) %>
            </td>
            <td>
                <%= Html.Encode(HtmlHelpers.Truncate(item.Title, 20)) %>
            </td>
            <td>
                <%=Html.Encode(String.Format("{0:F}",item.Price)) %>
            </td>
            
            <td>
                <%= Html.ActionLink("Edit", "Edit", new { id=item.AlbumId }) %> |
                <%= Html.ActionLink("Delete", "Delete", new { id=item.AlbumId })%>
            </td>
        </tr>
    
    <% } %>

    </table>

    

</asp:Content>

